<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员注册</title>
<link href="/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/m.js"></script>
<script type='text/javascript' src='http://partner.googleadservices.com/gampad/google_service.js'>
</script>
<script type='text/javascript'>
GS_googleAddAdSenseService("ca-pub-1676425181259485");
GS_googleEnableAllServices();
</script>
<script type='text/javascript'>
GA_googleAddSlot("ca-pub-1676425181259485", "365inf_index_middle_980_100");
</script>
<script type='text/javascript'>
GA_googleFetchAds();
</script>
</head>
<body>
<!--顶部小导航-->
<%include file="tp_sub.htm"%>
<!--头部导航加搜索-->
<%include file="header.htm"%>
<!--ad980-->
<div class="ad980">
<script type='text/javascript'>
GA_googleFillSlot("365inf_index_middle_980_100");
</script>
</div>
<div class="main_box">
 <p class="notice">
  <span class="fl">爱生活的你快来注册，成为分类信息网的会员吧！  </span>
  <!--
  <span class="fr"><img src="/images/dqq.png"/></span>
  <span class="fr">欢迎使用QQ登录:</span>
  -->
 </p>
 <div class="login">
  <form action="" method="post" id="register">
    <div ><label>用 户 名：</label><input name="username" id="username" type="text" class="tex_imp" /><span id="usernameDia"></span></div>
	<div><label>密　　码：</label><input name="password" id="password" type="password" class="tex_imp" /><span id="passwordDia"></span></div>
    <div><label>确认密码：</label><input name="password2" id="password2" type="password" class="tex_imp" /></div>
    <div><label>电子邮箱：</label><input name="email" id="email" type="text" class="tex_imp" /><span id="emailDia"></span></div>
    <p class="p80">(请填写真实有效的邮箱)</p>
    <!--
    <div>
    <label>所在省份：</label>
        <select name="province" class="province">
        <option value="">请选择</option>
        <%foreach item=val from=$province%>
    	<option value="<%$val.ProvinceName%>" pid="<%$val.ProvinceID%>"><%$val.ProvinceName%></option>
        <%/foreach%>
    	</select>
    </div>
    
    <div>
    	<label>所在城市：</label>
        <span class="city">
        <select name="city" class="">
        <option value="">请选择</option>
        <%foreach item=val from=$city%>
    	<option value="<%$val.CityName%>" pid="<%$val.ProvinceID%>"><%$val.CityName%></option>
        <%/foreach%>
    	</select>
        </span>
    </div>
    <script language="javascript">
	city = $(".city").clone();
	$(".province").change(function(){
		var pid = $(".province option:selected").attr("pid");
		$.post('/app/?m=city&a=getcitybypid',{"pid":pid},function(data){
			$(".city").html(data);
		});
	});
	</script>
    <div><label>真实姓名：</label><input name="name" type="text" class="tex_imp" /></div>
    <div><label>电　　话：</label><input name="tel" type="text" class="tex_imp" /></div>
    <div><label>传　　真：</label><input name="fax" type="text" class="tex_imp" /></div>
    -->
    <!-- 企业用户 -->
    <!--
    <div><label>用户类型：</label>个人用户<label><input name="enterprise" type="radio" value="0" checked="checked" /></label> <label>企业用户<input name="enterprise" type="radio" value="1" /></div></label>
    -->
    
    
    <div><label>验 证 码：</label><input name="code" type="text" class="tex_yz" /> <img src="/app/index.php?m=image&a=verification&t=<%$smarty.now%>" onclick='$(this).attr("src",$(this).attr("src")+"&t="+Math.random());' /><span id="codeDia"></span></div>
    <br />
    <div class="p80"><input name="" type="checkbox" value="" checked="checked" /><label>我已看过并同意<a href="/help/" target="_blank" title="">《分类信息服务条款》</a></label><br/></div>
    <input type="hidden" name="referrer" id="referrer" />
    <input name="" type="image" src="/images/zhuce.png" class="p80" />
  </form>
  <script language="javascript">
  	username = password = email = code = false;
	//check username
	$("#username").blur(function(){
		if ($(this).val() == "") {
			$("#usernameDia").html(" <span style=color:red><img src='/images/o_clip_image004_2.gif' />请填写用户名！</span>");
			username	= false;
			return false;
		}
		$.post('/app/?m=member&a=regcheck',{"username":$(this).val()},function(data){
			if (data	== 1){
				$("#usernameDia").html(" <span style=color:green><img src='/images/o_clip_image002_2.gif' /></span>");
				username	= true;
			}
			else {
				$("#usernameDia").html(" <span style=color:red><img src='/images/o_clip_image004_2.gif' />用户名不可用！</span>");
				username	= false;
			}
		});
	});
	//check code
	$("input[name=code]").blur(function(){
		if ($(this).val() == "") {
			$("#codeDia").html(" <span style=color:red><img src='/images/o_clip_image004_2.gif' />请填写验证码！</span>");
			username	= false;
			return false;
		}
		$.post('/app/?m=member&a=regcheck',{"code":$(this).val()},function(data){
			if (data	== 1){
				$("#codeDia").html(" <span style=color:green><img src='/images/o_clip_image002_2.gif' /></span>");
				code	= true;
				if (username && password && email && code){

				}
			}
			else {
				$("#codeDia").html(" <span style=color:red><img src='/images/o_clip_image004_2.gif' />验证码错误！</span>");
				code	= false;
			}
		});
	});
	//check password
	$("input[name=password2]").blur(function(){
		if ($(this).val() == "") {
			$("#passwordDia").html(" <span style=color:red><img src='/images/o_clip_image004_2.gif' />请确认密码！</span>");
			password	= false;
			return false;
		}
		
		var pass	= $("input[name=password]").val();	
		var pass2	= $("input[name=password2]").val();	
		if (pass !== pass2)
		{
			$("#passwordDia").html(" <span style=color:red><img src='/images/o_clip_image004_2.gif' /></span>");
			password	= false;
		}
		else {
			$("#passwordDia").html(" <span style=color:red><img src='/images/o_clip_image002_2.gif' /></span>");
			password	= true;
		}
	});
	
	//check email 
	$("input[name=email]").blur(function(){
		if ($(this).val() == "") {
			$("#emailDia").html(" <span style=color:red><img src='/images/o_clip_image004_2.gif' />请填写电子邮件地址！</span>");
			email	= false;
			return false;
		}
		var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
		var value = $(this).val();
		if(!myreg.test(value)){
			$("#emailDia").html(" <span style=color:red><img src='/images/o_clip_image004_2.gif' /></span>");
			email	= false;
		}
		else　{
			$("#emailDia").html(" <span style=color:red><img src='/images/o_clip_image002_2.gif' /></span>");
			email	= true;
		}
	});
	
	$("#register").submit(function(){
		if (!username) $("input[name=username]").blur();
		if (!password)$("input[name=password2]").blur();
		if (!email)$("input[name=email]").blur();
		if (!code)$("input[name=code]").blur()
		
		setTimeout(function(){
			if (username && password && email && code){

			}
			else {
				return false;
			}	
		},1000);
		
		
	});
	</script>
 </div>
 <div class="retrieve">
	已有帐号? <a href="/app/?m=member&a=login">立即登录</a><br/>
	忘记密码? <a href="/app/?m=member&a=repass">点此找回</a>
 </div>
 <div class="cl"></div>
</div>
<!--五大理由-->
<%include file="liyou.htm"%>
<%include file="footer.htm"%>
<script language="javascript">
var ref = ''; 
 if (document.referrer.length > 0) { 
  ref = document.referrer; 
 } 
 try { 
  if (ref.length == 0 && opener.location.href.length > 0) { 
   ref = opener.location.href; 
  } 
 } catch (e) {}
var url = document.getElementById("referrer");
url.value = (ref);
</script>
</body>
</html>